<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="JObj.js" type="text/javascript"></script>
</head>

<body>
<span id="xml">
<!--
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:dxp='http://schemas.google.com/analytics/2009'>
	<id>http://www.google.com/analytics/feeds/data?ids=ga:3879045&amp;dimensions=ga:month&amp;metrics=ga:pageviews,ga:uniquePageviews&amp;filters=ga:pagePath%3D~%26rid%3D51&amp;start-date=2009-01-01&amp;end-date=2009-04-30</id>
	<updated>2009-04-30T16:59:59.999-07:00</updated>
	<title type='text'>Google Analytics Data for Profile 3879045</title>
	<link rel='self' type='application/atom+xml' href='http://www.google.com/analytics/feeds/data?sort=ga%3Amonth&amp;end-date=2009-04-30&amp;start-date=2009-01-01&amp;metrics=ga%3Apageviews%2Cga%3AuniquePageviews&amp;ids=ga%3A3879045&amp;dimensions=ga%3Amonth&amp;filters=ga%3ApagePath%3D%7E%26rid%3D51'/>
	<author>
		<name>Google Analytics</name>
	</author>
	<generator version='1.0'>Google Analytics</generator>
	<openSearch:totalResults>4</openSearch:totalResults>
	<openSearch:startIndex>1</openSearch:startIndex>
	<openSearch:itemsPerPage>100</openSearch:itemsPerPage>
	<dxp:startDate>2009-01-01</dxp:startDate>
	<dxp:endDate>2009-04-30</dxp:endDate>
	<dxp:aggregates>
		<dxp:metric confidenceInterval='0.0' name='ga:pageviews' type='integer' value='924'/>
		<dxp:metric confidenceInterval='0.0' name='ga:uniquePageviews' type='integer' value='840'/>
	</dxp:aggregates>
	<dxp:dataSource>
		<dxp:tableId>ga:3879045</dxp:tableId>
		<dxp:tableName>www.xxx.nz</dxp:tableName>
		<dxp:property name='ga:profileId' value='3879045'/>
		<dxp:property name='ga:webPropertyId' value='UA-1779958-2'/>
		<dxp:property name='ga:accountName' value='12rmb'/>
	</dxp:dataSource>
	<entry>
		<id>http://www.google.com/analytics/feeds/data?ids=ga:3879045&amp;ga:month=01&amp;filters=ga:pagePath%3D~%26rid%3D51&amp;start-date=2009-01-01&amp;end-date=2009-04-30</id>
		<updated>2009-04-29T17:00:00.001-07:00</updated>
		<title type='text'>ga:month=01</title>
		<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
		<dxp:dimension name='ga:month' value='01'/>
		<dxp:metric confidenceInterval='0.0' name='ga:pageviews' type='integer' value='0'/>
		<dxp:metric confidenceInterval='0.0' name='ga:uniquePageviews' type='integer' value='0'/>
	</entry>
	<entry>
		<id>http://www.google.com/analytics/feeds/data?ids=ga:3879045&amp;ga:month=02&amp;filters=ga:pagePath%3D~%26rid%3D51&amp;start-date=2009-01-01&amp;end-date=2009-04-30</id>
		<updated>2009-04-29T17:00:00.001-07:00</updated>
		<title type='text'>ga:month=02</title>
		<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
		<dxp:dimension name='ga:month' value='02'/>
		<dxp:metric confidenceInterval='0.0' name='ga:pageviews' type='integer' value='0'/>
		<dxp:metric confidenceInterval='0.0' name='ga:uniquePageviews' type='integer' value='0'/>
	</entry>
</feed>
-->
</span>
<script type="text/javascript">
var namespaceUrlMapper = function( prefix ){
	var url = "";
	switch(prefix){
		case "dxp":
			url = "http://schemas.google.com/analytics/2009";
			break;
		case "openSearch":
			url = "http://a9.com/-/spec/opensearchrss/1.0/";
	}
	return url;
}

var xml = JObj.$("xml").innerHTML.replace(/<!--|-->/g,"").trim();
var dom = JObj.Xml.loadXML(xml);
var result = dom.evaluate("//dxp:metric",dom, namespaceUrlMapper,XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
while( metric = result.iterateNext()){
	alert(metric.xml);
}

result = dom.evaluate("//openSearch:*", dom , namespaceUrlMapper, XPathResult.ORDERED_NODE_ITERATOR_TYPE  , null);
while( metric = result.iterateNext()){
	alert( metric.nodeName + " = " +  metric.firstChild.nodeValue);
}
</script>
</body>
</html>
